package com.carl.zlds.dao.sqlprovider;

import java.util.HashMap;

/**
 * @Author: carl
 * @Date: 2020/6/24 2:29 PM
 */
public class GameTagSqlProvider {
    public String getGameTagList(HashMap<String, Object> param) {
        Long gameId = (Long) param.get("gameId");
        StringBuilder sql = new StringBuilder();
        sql.append(" select a.* ");
        sql.append(" from game_tag a ");
        sql.append(" where a.weight >= 0 ");
        if (gameId > 0) {
            sql.append(" and a.game_id = #{gameId} ");
        }
        sql.append(" order by a.sort asc, a.create_time desc ");

        return sql.toString();
    }
}
